package com.javalab._7thread._3Lock._2Volatile;

public class CommonData {
    /**
     * 考虑使用volatile的场景：
     * 1、静态变量
     * 2、内部类访问外部类的变量
     */
    private static volatile boolean stop = false;

    public static boolean isStop() {
        return stop;
    }

    public static void setStop(boolean stop) {
        CommonData.stop = stop;
    }
}
